package agent
import agent.ccs.CCSCalculus
import cwb.Module
import cwb.Command
import agent.ccs.CCSAgent


trait Agent {
  def agentString: String
  def diverges(): Boolean
  def printAgent(): Unit
  def transitions(): List[(Action, Agent)]
}
trait AgentObject {
  //type Transition = (AgAction, Agent)
  def printTransList(trans: List[(Action, Agent)]): Unit

  
}

trait Action {

  def mkstr(): String
  def observable(): Boolean
  
  def geAction(rhs: Action): Boolean
  def leAction(rhs: Action): Boolean


  override
  def equals(rhs: Any): Boolean
  
}

trait AgTau extends Action


trait AgentParser {
  def readAgent(input: String): Agent
  def getAgentPair(input: String): (Agent, Agent)
  def readAct(input:String): Action
}

trait AgentCalculus {
  val agentObject: AgentObject
  val parser: AgentParser
  val component: Module
  val Tau: AgTau
  val agentCommand: Command
  def bindVarsToAgents(symAgList: List[(Symbol, Agent)])
  def makeAgentFromNextSteps(lst: List[(Action, List[Symbol])]): Agent
}


object Agent {
  // The specific calculus
  val calculus = CCSCalculus
  // Parser of the language
  val parser = calculus.parser
  val agentObject = calculus.agentObject
  val Tau = calculus.Tau
  def printTransList(trans: List[(Action, Agent)]) = agentObject.printTransList(trans)

  def readAgent(input: String) = parser.readAgent(input)

  def bindVarsToAgents(symAgList: List[(Symbol, Agent)]) = calculus.bindVarsToAgents(symAgList)
  def makeAgentFromNextSteps(lst: List[(Action, List[Symbol])]): Agent = calculus.makeAgentFromNextSteps(lst)
  
  
  def component = calculus.component
  val agentCommand = calculus.agentCommand
  def readAct(input: String) = parser.readAct(input)
  
}